home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 November / Macworld Nov ’95.toast / Developers / BoxMaker++ / BoxMaker++ ƒ / headers / boxmakergetfile.h < prev    next >
Encoding:
Text File  |  1995-06-14  |  1.9 KB  |  72 lines  |  [TEXT/KAHL]

  1. //
  2. // boxmakergetfile assumes that, if the dialog given to it has a tenth
  3. // item, it is a button called 'Select highlighted item'
  4. //
  5. typedef struct OSTypePair
  6. {
  7.     OSType type;
  8.     OSType creator;
  9. } OSTypePair;
  10.  
  11. class boxmakergetfile : public standardgetfile
  12. {
  13.     public:
  14.         boxmakergetfile( short dlogID = sfGetDialogID);
  15.         
  16. //        ~boxmakergetfile();
  17.  
  18.     protected:
  19.  
  20.         Boolean matchesTypeList( OSType ourType) const;
  21.         Boolean matchesTypeCreatorPairs( OSType theType, OSType theCreator) const;
  22.         //
  23.         // Functions to read the list of types accepted by this application,
  24.         // as read from the 'tycr' resource #128. Present for use by subclasses.
  25.         //
  26.         const OSTypePair *GetTheTypeCreatorPairs() const;
  27.         short GetNumTypeCreatorPairs() const;
  28.  
  29.         virtual Boolean filterThisItem( const CInfoPBPtr myPB);
  30.         virtual short handleItemPress( short item, DialogPtr theDialog);
  31.         //
  32.         // Four booleans, read from 'flgs' resource #128:
  33.         //
  34.         Boolean enterFolders;
  35.         Boolean passFolders;
  36.         Boolean enterInvisibles;
  37.         Boolean passInvisibles;
  38.         //
  39.         // A boolean, derived from the above flags, cached for efficiency:
  40.         //
  41.         Boolean allowFolderSelection;
  42.  
  43.         static Boolean matches( OSType original, OSType pattern);
  44.  
  45.         ControlHandle selectThisItemControl;
  46.         //
  47.         // the list of file types to look at, as read from the 'typs' resource #128
  48.         // (950531: these are stored as part of the 'standardgetfile' superclass)
  49.         //
  50.         // the list which further restricts the type/creator pairs.
  51.         // Read from 'tycr' resource #128
  52.         //
  53.         OSTypePair *theTypeCreatorPairs;
  54.         short   numTypeCreatorPairs;
  55. };
  56.  
  57. inline Boolean boxmakergetfile::matches( OSType original, OSType pattern)
  58. {
  59.     return ((original == pattern) || (pattern == '****'));
  60. }
  61.  
  62. inline const OSTypePair *boxmakergetfile::GetTheTypeCreatorPairs() const
  63. {
  64.     return (const OSTypePair *)theTypeCreatorPairs;
  65. }
  66.  
  67. inline short boxmakergetfile::GetNumTypeCreatorPairs() const
  68. {
  69.     return numTypeCreatorPairs;
  70. }
  71.  
  72.